﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="homologousControl.ascx.cs" Inherits="PayrollHR.Administration.Modules.homologousControl" %>
<%@ Register Src="ToolTipLabelControl.ascx" TagName="ToolTipLabelControl" TagPrefix="uc1" %>
<%@ Register Src="DatePicker.ascx" TagName="DatePicker" TagPrefix="uc2" %>
<script type="text/javascript">
    $(window).bind('load', function () {
        var cbHeader = $(".cbHeader input");
        var cbRowItem = $(".cbRowItem input");
        cbHeader.bind("click", function () {
            cbRowItem.each(function () { this.checked = cbHeader[0].checked; })
        });
        cbRowItem.bind("click", function () { if ($(this).checked == false) cbHeader[0].checked = false; });
    });
    function ClearText() {
        document.getElementById('<%=txtDistributor.ClientID%>').value = '';
    };
    function ClearTextWarehouse() {
        document.getElementById('<%=txtMobile.ClientID%>').value = '';
        document.getElementById('<%=txtEmail.ClientID%>').value = '';
    };
</script>
<div class="section-header">
    <div class="title">
        <img src="Common/ico-sales.png" alt="<%=GetLocaleResourceString("Admin.homologous.Title")%>" />
        <%=GetLocaleResourceString("Admin.homologous.Title")%>
    </div>
    <div class="options">
        <asp:HyperLink runat="server" Visible="False" ID="hlexport" ForeColor="#6600CC">[hlexport]</asp:HyperLink>
        <asp:Button ID="SearchButton" runat="server" Text="<%$ PayrollResources:Admin.Orders.SearchButton %>"
                        CssClass="adminButtonBlue" OnClick="SearchButton_Click" ToolTip="<%$ PayrollResources:Admin.Orders.SearchButton.Tooltip %>" />
        <asp:Button ID="ExportButton" runat="server" Text="<%$ PayrollResources:Admin.homologous.Export %>"
            CssClass="adminButtonBlue" OnClick="ExportButton_Click" ToolTip="<%$ PayrollResources:Admin.homologous.Export.Tooltip %>" />
    </div>
</div>
<div style="border: 1px solid #2F00FF; border-radius: 15px;">
    <table class="adminContent">
        <tr>
            <td class="adminTitle">
                <uc1:ToolTipLabelControl ID="ToolTipLabelControl1" runat="server" Text="<%$ PayrollResources:Admin.homologous.DateTo.Text %>"
                    ToolTip="<%$ PayrollResources:Admin.homologous.DateTo.ToolTip %>" ToolTipImage="~/Administration/Common/ico-help.gif" />
            </td>
            <td class="adminData">
                <uc2:DatePicker ID="ctrlToDatePicker" runat="server" />
            </td>
            <td class="adminTitle">
                <uc1:ToolTipLabelControl ID="ToolTipLabelControl2" runat="server" Text="<%$ PayrollResources:Admin.homologous.NPP.Text %>"
                    ToolTip="<%$ PayrollResources:Admin.homologous.NPP.ToolTip %>" ToolTipImage="~/Administration/Common/ico-help.gif" />
            </td>
            <td class="adminData">
                <asp:TextBox ID="txtDistributor" CssClass="adminInput" runat="server"></asp:TextBox>
            </td>
            <td class="adminTitle">
                <uc1:ToolTipLabelControl ID="ToolTipLabelControl3" runat="server" Text="<%$ PayrollResources:Admin.homologous.Mobile.Text %>"
                    ToolTip="<%$ PayrollResources:Admin.homologous.Mobile.ToolTip %>" ToolTipImage="~/Administration/Common/ico-help.gif" />
            </td>
            <td class="adminData">
                <asp:TextBox ID="txtMobile" CssClass="adminInput" runat="server"></asp:TextBox>
            </td>
            <td class="adminTitle">
                <uc1:ToolTipLabelControl ID="ToolTipLabelControl4" runat="server" Text="<%$ PayrollResources:Admin.homologous.Email.Text %>"
                    ToolTip="<%$ PayrollResources:Admin.homologous.Email.ToolTip %>" ToolTipImage="~/Administration/Common/ico-help.gif" />
            </td>
            <td class="adminData">
                <asp:TextBox ID="txtEmail" CssClass="adminInput" runat="server"></asp:TextBox>
            </td>
        </tr>
    </table>
</div>
<p></p>
<div>
    <asp:GridView ID="gvDistributor" runat="server" AutoGenerateColumns="False" Width="100%" DataKeyNames="CustomerId"
        OnPageIndexChanging="gvDistributor_PageIndexChanging" AllowPaging="True" PageSize="15">
        <Columns>
            <asp:TemplateField>
                <HeaderTemplate>
                    <asp:CheckBox ID="cbSelectAll" runat="server" CssClass="cbHeader" />
                </HeaderTemplate>
                <ItemTemplate>
                    <asp:CheckBox ID="cbCustomerId" runat="server" CssClass="cbRowItem" ToolTip="<% $PayrollResources:Admin.Customers.CustName.ToolTip %>" />
                    <asp:HiddenField ID="hfCustomerId" runat="server" Value='<%# Eval("CustomerId") %>' />
                </ItemTemplate>
                <ItemStyle HorizontalAlign="Center" Width="0.5%" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Tên Nhà Phân Phối" ItemStyle-Width="20%">
                <ItemTemplate>
                    <asp:HyperLink ID="ActionHyperLink" runat="server" ToolTip="Click vào tên nhà phân phối để xem chi tiết" Text='<%# Eval("CustName") %>' NavigateUrl='<%# String.Format("../CustomerAdd.aspx?CustomerId={0}", Eval("CustomerID")) %>' />
                </ItemTemplate>
                <ItemStyle Width="20%" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Loại" ItemStyle-Width="4%">
                <ItemTemplate>
                    <asp:Label runat="server" ID="lblCustTypeName" Text='<%#Eval("CustTypeName") %>'></asp:Label>
                </ItemTemplate>
                <ItemStyle Width="4%" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Email"
                HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Left">
                <ItemTemplate>
                    <asp:Label runat="server" ID="lblCustEmail" Text='<%#Eval("CustEmail") %>'></asp:Label>
                </ItemTemplate>
                <HeaderStyle HorizontalAlign="Center" />
                <ItemStyle HorizontalAlign="Left" Width="5%" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Điện thoại"
                HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Left">
                <ItemTemplate>
                    <asp:Label runat="server" ID="lblCustPhoneNumber" Text='<%#Eval("CustPhoneNumber") %>'></asp:Label>
                </ItemTemplate>
                <HeaderStyle HorizontalAlign="Center" />
                <ItemStyle HorizontalAlign="Left" Width="5%" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="<%$ PayrollResources:Admin.CustomerInfo.CustMobile.Text %>"
                HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Left">
                <ItemTemplate>
                    <asp:Label runat="server" ID="lblCustMobile" Text='<%#Eval("CustMobile") %>'></asp:Label>
                </ItemTemplate>
                <HeaderStyle HorizontalAlign="Center" />
                <ItemStyle HorizontalAlign="Left" Width="5%" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Người liên hệ"
                HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Left">
                <ItemTemplate>
                    <asp:Label runat="server" ID="lblCustContact" Text='<%#Eval("CustContact") %>'></asp:Label>
                </ItemTemplate>
                <HeaderStyle HorizontalAlign="Center" />
                <ItemStyle HorizontalAlign="Left" Width="5%" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Triết khấu"
                HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Left">
                <ItemTemplate>
                    <asp:Label runat="server" ID="lblDiscountPercentage" Text='<%#Eval("DiscountPercentage") %>'></asp:Label>
                </ItemTemplate>
                <HeaderStyle HorizontalAlign="Center" />
                <ItemStyle HorizontalAlign="Left" Width="5%" />
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
</div>
